import Vue from 'vue'
import Router from 'vue-router'
import index from '../views/index'
import page1 from '../components/page1'
import page2 from '../components/page2'
import page3 from '../components/page3'
import page4 from '../components/page4'
import page5 from '../components/page5'
import menuWrapper from '../views/menuWrapper'
import layuiWrapper from '../views/layuiWrapper'
import menu from '../components/menu'
import carousel from '../components/carousel'
import duDate from '../components/duDate'
import selectDown from '../components/selectDown.vue'

Vue.use(Router)

const router = new Router({
  mode: 'history',
  routes: [{
    path: '/index',
    component: index,
    children: [
      {
        path: 'page1',
        component: page1
      },
      {
        path: 'menuWrapper',
        component: menuWrapper
      },
      {
        path: 'page3',
        component: page3
      },
      {
        path: 'page4',
        component: page4
      },
      {
        path: 'page5',
        component: page5
      }]
  },
  {
    path: '/menuWrapper',
    component: menuWrapper,
    children: [
      {
        path: 'page1',
        component: page1
      },
      {
        path: 'page2',
        component: page2
      },
      {
        path: 'page3',
        component: page3
      },
      {
        path: 'page4',
        component: page4
      },
      {
        path: 'page5',
        component: page5
      }]
  },
  {
    path: '/layuiWrapper',
    component: layuiWrapper
  },
  {
    path: '/carousel',
    component: carousel
  },
  {
    path: '/menu',
    component: menu
  },
  {
    path: '/duDate',
    component: duDate
  },
  {
    path: '/selectDown',
    component: selectDown
  },
  {
    // path: '*', redirect: '/index/page1'
    path: '*', redirect: '/layuiWrapper'
  }]
})
export default router
